package day5;

public class facefengzhuang {
    public static void main(String[] args) {
        int[] array = {1, 2, 9, 8, 10, 19, 5};
        int max = getmax(array);
        System.out.println("该数组最大值是" + max);
    }

    public static int getmax(int[] array) {
        int max = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }
        }return max;
    }
}
